<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<h2>{{message}}</h2>
			<!-- .stop修饰符 -->
			<div @click="divClick">
				<button @click.stop="btnClick">点击</button>
			</div>
			<br />
			<!-- .prevent修饰符 -->
			<form action="baidu" method="post">
				<input type="submit" value="提交" @click.prevent="submitClick"/>
			</form>
			
			<!-- 监听某个键盘按键的点击 -->
			<input type="text" @keyup.enter="keyUp" name="" id="" value="" />
			
			<br />
			<!-- .once修饰符 -->
			<button @click.once="onceClick">点击</button>
		</div>
	</body>
	<script type="text/javascript">
		const app = new Vue({
			el:'#app',
			data:{
				message:'你好'
			},
			methods:{
				divClick(){
					console.log('divClick');
				},
				btnClick(){
					console.log('btnClick');
				},
				submitClick(){
					console.log('submitclick');
				},
				keyUp(){
					console.log('keyUp');
				},
				onceClick(){
					console.log('onceclick');
				}
			}
		})
	</script>
</html>
